<!DOCTYPE html>
<html> 
<head> 
	<title>Simple Example</title> 

	<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false" type="text/javascript"></script> 
	<script src="js/three.min.js"></script>
	<script src="js/GSVPano.js"></script>
	<script src="../src/Hyperlapse.js"></script>
	<script> 

		function init() {

			var hyperlapse = new Hyperlapse(document.getElementById('pano'), {
				lookat: new google.maps.LatLng(37.81409525128964,-122.4775045005249),
				zoom: 1,
				use_lookat: true,
				elevation: 50
			});

			hyperlapse.onError = function(e) {
				console.log(e);
			};

			hyperlapse.onRouteComplete = function(e) {
				hyperlapse.load();
			};

			hyperlapse.onLoadComplete = function(e) {
				hyperlapse.play();
			};

			// Google Maps API stuff here...
			var directions_service = new google.maps.DirectionsService();

			var route = {
				request:{
					origin: new google.maps.LatLng(37.816480000000006,-122.47825,37),
					destination: new google.maps.LatLng(37.81195,-122.47773000000001),
					travelMode: google.maps.DirectionsTravelMode.DRIVING
				}
			};

			directions_service.route(route.request, function(response, status) {
				if (status == google.maps.DirectionsStatus.OK) {
					hyperlapse.generate( {route:response} );
				} else {
					console.log(status);
				}
			});

		}

		window.onload = init;
		
	</script> 
</head> 
<body> 
	<div id="pano"></div>
</body> 
</html>